#ifndef _LIGHTCOMP_H_
#define _LIGHTCOMP_H_

#include <SECore/Ecs/Component.h>
#include <SERender/Entity/Light.h>
#include <SECore/Reflect.h>
#include <SECore/Util.h>

namespace SEngine
{

    struct PointLightComp : public Component<PointLightComp> 
    {
        ENABLE_SERIALIZE(Component<PointLightComp>)
        PointLightComp(Actor & actor) : Component(actor) {}
        virtual ~PointLightComp() = default;
        virtual void Attach() override;
        PointLight light;
    };
    REF_REGISTER_CLASS(PointLightComp,
        REF_REGISTER_FIELD(PointLightComp, light)
    )

    struct DirectLightComp : public Component<DirectLightComp> 
    {
        ENABLE_SERIALIZE(Component<DirectLightComp>)
        DirectLightComp(Actor & actor) : Component(actor) {}
        virtual ~DirectLightComp() = default;
        virtual void Attach() override;
        DirectLight light;
    };
    REF_REGISTER_CLASS(DirectLightComp,
        REF_REGISTER_FIELD(DirectLightComp, light)
    )

    struct AmbientLightSphereComp : public Component<AmbientLightSphereComp>
    {
        ENABLE_SERIALIZE(Component<AmbientLightSphereComp>)
        AmbientLightSphereComp(Actor & actor) : Component(actor) {}
        virtual ~AmbientLightSphereComp() = default;
        virtual void Attach() override;
        AmbientSphereLight light;
    };
    REF_REGISTER_CLASS(AmbientLightSphereComp,
        REF_REGISTER_FIELD(AmbientLightSphereComp, light)
    )

    using LightComp = TypesLoader<
        PointLightComp,
        DirectLightComp,
        AmbientLightSphereComp
    >;

} // namespace SEngine

#endif